import request from '@/utils/request';
import { download } from '@/utils/request';

// 新增组合组别
export function addZhGroup(data) {
  return request({
    url: '/businessCore/faCombinationQuestionsGroup',
    method: 'post',
    data,
  });
}

// 修改组合组别
export function updateZhGroup(data) {
  return request({
    url: '/businessCore/faCombinationQuestionsGroup',
    method: 'put',
    data,
  });
}

// 删除组合组别
export function delZhGroup(id) {
  return request({
    url: '/businessCore/faCombinationQuestionsGroup/' + id,
    method: 'delete',
  });
}

// 导出组合组别
export function exportZhGroup(params, fileName) {
  const url = '/businessCore/faCombinationQuestionsGroup/export';
  download(url, params, fileName + `_${new Date().getTime()}.xlsx`);
}

// 新增组合题
export function addZh(data) {
  return request({
    url: '/businessCore/faCombinationQuestions',
    method: 'post',
    data,
  });
}

// 修改组合题
export function updateZh(data) {
  return request({
    url: '/businessCore/faCombinationQuestions',
    method: 'put',
    data,
  });
}

// 删除组合题
export function delZh(id) {
  return request({
    url: '/businessCore/faCombinationQuestions/' + id,
    method: 'delete',
  });
}

// 获取组合题
export function getZh(id) {
  return request({
    url: '/businessCore/faCombinationQuestions/' + id,
    method: 'get',
  });
}

// 设置为第一题
export function setZh(id) {
  return request({
    url: '/businessCore/faCombinationQuestions/changeToTheFirstQuestion/' + id,
    method: 'put',
  });
}

// 导出组合题
export function exportZh(params, fileName) {
  const url = '/businessCore/faCombinationQuestions/export';
  download(url, params, fileName + `_${new Date().getTime()}.xlsx`);
}
